#include "dominion.h"
#include "dominion_helpers.h"
#include <string.h>
#include <stdio.h>
#include <stdlib.h>
#include <assert.h>
#include <math.h>
#include "rngs.h"
#include "interface.h"


int randInt(int low, int high)
{
	int temp = low + rand() % (high -low +1);
	return temp;

}




int main (int argc, char** argv)
{


	int seed;
	int n;
	int numPlayers;
	int success;
	int k[10];
	int numerrors=0;


	seed = rand();
	SelectStream(1);
	PutSeed(seed);

	//set up how many random games to play
		for (n = 0; n < 100; n++) {

		newGame();
		struct gameState G;
		printf("Initializing game...%d\n", n);
		numPlayers = floor(Random() * MAX_PLAYERS); //make number of players random
		  if (numPlayers < 2){ 	numPlayers = 2;  }
		  else if (numPlayers > 4){	numPlayers= 4;  }

		  //generate random kingdom cards
		  selectKingdomCards(rand(),k);



		//Initialize Game
		success = initializeGame(numPlayers, k, seed, &G);

		if (success != 0) {
			numerrors++;
			printf("Initializing Game Error");
			exit(0);
		}

	}

		printf("All initialization tests ran successfully.\n");
		printf("Number of errors found was %d\n", numerrors);
	return 0;
}

